﻿<UserControl x:Class="InseSoft.Views.Controls.CotizacionEdit"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:viewModels="clr-namespace:InseSoft.ViewModels"
             mc:Ignorable="d" 
             d:DesignHeight="575" d:DesignWidth="670">
    <UserControl.Resources>
        <Style TargetType="Label" >
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="Height" Value="23" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="BorderBrush" Value="SlateGray" />
            <Setter Property="Background" Value="WhiteSmoke" />
        </Style>
        <Style TargetType="Label" x:Key="Header" >
            <Setter Property="VerticalAlignment" Value="Stretch" />
            <Setter Property="VerticalContentAlignment" Value="Stretch" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Width" Value="Auto" />
            <Setter Property="Background" Value="LightSlateGray" />
            <Setter Property="Foreground" Value="White" />
            <Setter Property="FontWeight" Value="Bold" />
        </Style>
        <Style TargetType="TextBlock">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Margin" Value="5" />
        </Style>
        <Style TargetType="TextBox">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="Height" Value="23" />
        </Style>
        <Style TargetType="ComboBox">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="HorizontalAlignment" Value="Left" />
        </Style>
    </UserControl.Resources>
    <Grid d:DataContext="{d:DesignInstance {x:Type viewModels:CotizacionViewModel}}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="120" />
            <RowDefinition Height="210" />
            <RowDefinition Height="230" />
        </Grid.RowDefinitions>
        <Grid Name="General">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="80" />
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="100" />
                <ColumnDefinition Width="100" />
                <ColumnDefinition Width="80" />
                <ColumnDefinition Width="100" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="27" />
                <RowDefinition Height="27" />
                <RowDefinition Height="27" />
                <RowDefinition Height="27" />
                <RowDefinition Height="27" />
            </Grid.RowDefinitions>
            <TextBlock Text="Código" Grid.Row="0"/>
            <TextBlock Text="Cliente" Grid.Row="1" />
            <TextBlock Text="Vendedor" Grid.Row="2" />
            <TextBlock Text="Línea" Grid.Row="3" />
            <TextBlock Text="Evento" Grid.Row="1" Grid.Column="4"/>
            <TextBlock Text="Pedido #" Grid.Row="2" Grid.Column="4"/>
            <TextBlock Grid.Row="0" Grid.Column="1" FontWeight="Bold" Text="{Binding Path=CurrentEntity.FriendlyId}" />
            <ComboBox Grid.Row="1" Grid.Column="1" Width="200" ItemsSource="{Binding Clientes}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Nombre}" TextTrimming="CharacterEllipsis" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <ComboBox Grid.Row="2" Grid.Column="1" Width="200" ItemsSource="{Binding Vendedores}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Nombre}" TextTrimming="CharacterEllipsis" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <ComboBox Grid.Row="3" Grid.Column="1" Width="200" ItemsSource="{Binding Lineas}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Nombre}" TextTrimming="CharacterEllipsis" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <TextBox Grid.Row="1" Grid.Column="5" Width="100" MaxLength="20" Text="{Binding Path=CurrentEntity.PorcEvento, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
            <TextBox Grid.Row="2" Grid.Column="5" Width="100" MaxLength="20" Text="{Binding Path=CurrentEntity.NumPedido, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        </Grid>
        <GroupBox Name="Producto" Grid.Row="1" Header="Datos del Producto" Margin="3" Padding="5">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="60" />
                    <ColumnDefinition Width="75" />
                    <ColumnDefinition Width="20" />
                    <ColumnDefinition Width="60" />
                    <ColumnDefinition Width="75" />
                    <ColumnDefinition Width="30" />
                    <ColumnDefinition Width="80" />
                    <ColumnDefinition Width="75" />
                    <ColumnDefinition Width="20" />
                    <ColumnDefinition Width="80" />
                    <ColumnDefinition Width="75" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="27" />
                    <RowDefinition Height="27" />
                    <RowDefinition Height="27" />
                    <RowDefinition Height="27" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <TextBlock Text="Material" Grid.Row="0"/>
                <TextBlock Text="Base" Grid.Row="1" />
                <TextBlock Text="Cantidad" Grid.Row="2" />
                <TextBlock Text="Observaciones" Grid.Row="3" Grid.ColumnSpan="2" />
                <TextBlock Text="Altura" Grid.Row="1" Grid.Column="3"/>
                <TextBlock Text="Tintas" Grid.Row="2" Grid.Column="3"/>
                <TextBlock Text="Cubrimiento" Grid.Row="0" Grid.Column="6"/>
                <TextBlock Text="Cuatricromía" Grid.Row="1" Grid.Column="6"/>
                <TextBlock Text="Doblez" Grid.Row="2" Grid.Column="6" />
                <TextBlock Text="Montaje" Grid.Row="0" Grid.Column="9"/>
                <TextBlock Text="Troquel" Grid.Row="1" Grid.Column="9"/>
                <TextBlock Text="Otros" Grid.Row="2" Grid.Column="9" />
                <Label Grid.Row="0" Grid.Column="5" Grid.ColumnSpan="1" Grid.RowSpan="4" Width="1" Height="80" BorderThickness="1" BorderBrush="DarkSlateGray" VerticalAlignment="Top" HorizontalAlignment="Center" />
                <ComboBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="4" Width="230" ItemsSource="{Binding Materiales}">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Nombre}" TextTrimming="CharacterEllipsis" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <TextBox Grid.Row="1" Grid.Column="1" Width="75" MaxLength="10" Text="{Binding Path=CurrentEntity.Base, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                <TextBox Grid.Row="2" Grid.Column="1" Width="75" MaxLength="10" Text="{Binding Path=CurrentEntity.Cantidad, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                <TextBox Grid.Row="1" Grid.Column="4" Width="75" MaxLength="10" Text="{Binding Path=CurrentEntity.Altura, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                <TextBox Grid.Row="2" Grid.Column="4" Width="75" MaxLength="10" Text="{Binding Path=CurrentEntity.Tintas, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                <TextBox Grid.Row="0" Grid.Column="7" Width="75" MaxLength="10" Text="{Binding Path=CurrentEntity.Cubrimiento, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                <TextBox Grid.Row="1" Grid.Column="7" Width="75" MaxLength="10" Text="{Binding Path=CurrentEntity.Cuatricromia, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                <TextBox Grid.Row="2" Grid.Column="7" Width="75" MaxLength="10" Text="{Binding Path=CurrentEntity.Doblez, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                <TextBox Grid.Row="0" Grid.Column="10" Width="75" MaxLength="10" Text="{Binding Path=CurrentEntity.Montaje, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                <TextBox Grid.Row="1" Grid.Column="10" Width="75" MaxLength="10" Text="{Binding Path=CurrentEntity.Troquel, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                <TextBox Grid.Row="2" Grid.Column="10" Width="75" MaxLength="10" Text="{Binding Path=CurrentEntity.Otro, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                <TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="10" Width="590" MaxLength="200" TextWrapping="Wrap" MaxLines="5" Height="60" VerticalAlignment="Top" Text="{Binding Path=CurrentEntity.Observacion, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
            </Grid>
        </GroupBox>
        <GroupBox Name="Resultados" Grid.Row="2" Header="Resultados" Margin="3" Padding="5">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition Width="30" />
                    <ColumnDefinition Width="315" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="150" />
                    <RowDefinition Height="50" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid Name="Precios">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="65" />
                        <ColumnDefinition Width="75" />
                        <ColumnDefinition Width="20" />
                        <ColumnDefinition Width="60" />
                        <ColumnDefinition Width="75" />
                        <ColumnDefinition Width="5" />
                        <ColumnDefinition Width="10" />
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="75" />
                        <ColumnDefinition Width="20" />
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="75" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="27" />
                        <RowDefinition Height="27" />
                        <RowDefinition Height="27" />
                        <RowDefinition Height="27" />
                        <RowDefinition Height="27" />
                        <RowDefinition Height="10" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Frame Grid.ColumnSpan="6" Grid.RowSpan="6" BorderBrush="Gray" BorderThickness="1"/>
                    <Label Style="{StaticResource Header}"  Grid.ColumnSpan="6" Content="Precios" Grid.Row="0"/>
                    <TextBlock Text="Material" Grid.Row="1" />
                    <TextBlock Text="Solventes" Grid.Row="2" />
                    <TextBlock Text="Tintas" Grid.Row="3" />
                    <TextBlock Text="Impresión" Grid.Row="4" />
                    <TextBlock Text="Moldes" Grid.Row="1" Grid.Column="3" />
                    <TextBlock Text="Positivos" Grid.Row="2" Grid.Column="3"/>
                    <TextBlock Text="Arte" Grid.Row="3" Grid.Column="3"/>
                    <TextBlock Text="Corte" Grid.Row="4" Grid.Column="3"/>
                    <Label Grid.Row="1" Grid.Column="1" Width="75" Content="{Binding Path=CurrentEntity.PrecioMaterial}"/>
                    <Label Grid.Row="2" Grid.Column="1" Width="75" Content="{Binding Path=CurrentEntity.PrecioSolvente}"/>
                    <Label Grid.Row="3" Grid.Column="1" Width="75" Content="{Binding Path=CurrentEntity.PrecioTintas}"/>
                    <Label Grid.Row="4" Grid.Column="1" Width="75" Content="{Binding Path=CurrentEntity.PrecioImpresion}"/>
                    <Label Grid.Row="1" Grid.Column="4" Width="75" Content="{Binding Path=CurrentEntity.PrecioMolde}"/>
                    <Label Grid.Row="2" Grid.Column="4" Width="75" Content="{Binding Path=CurrentEntity.PrecioPositivo}"/>
                    <Label Grid.Row="3" Grid.Column="4" Width="75" Content="{Binding Path=CurrentEntity.PrecioArte}"/>
                    <Label Grid.Row="4" Grid.Column="4" Width="75" Content="{Binding Path=CurrentEntity.PrecioCorte}"/>
                </Grid>
                <Grid Name="DivisionMaterial" Grid.Column="2">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="75" />
                        <ColumnDefinition Width="20" />
                        <ColumnDefinition Width="60" />
                        <ColumnDefinition Width="75" />
                        <ColumnDefinition Width="5" />
                        <ColumnDefinition Width="10" />
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="75" />
                        <ColumnDefinition Width="20" />
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="75" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="27" />
                        <RowDefinition Height="27" />
                        <RowDefinition Height="27" />
                        <RowDefinition Height="27" />
                        <RowDefinition Height="27" />
                        <RowDefinition Height="10" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Frame Grid.ColumnSpan="6" Grid.RowSpan="6" BorderBrush="Gray" BorderThickness="1"/>
                    <Label Style="{StaticResource Header}" Grid.ColumnSpan="6" Content="División del Material" Grid.Row="0"/>
                    <TextBlock Text="Rendimiento" Grid.Row="1" />
                    <TextBlock Text="Ancho" Grid.Row="2" />
                    <TextBlock Text="Láminas" Grid.Row="1" Grid.Column="3" />
                    <TextBlock Text="Largo" Grid.Row="2" Grid.Column="3"/>
                    <Label Grid.Row="1" Grid.Column="1" Width="75" Content="{Binding Path=CurrentEntity.PrecioMaterial}"/>
                    <Label Grid.Row="2" Grid.Column="1" Width="75" Content="{Binding Path=CurrentEntity.PrecioSolvente}"/>
                    <Label Grid.Row="1" Grid.Column="4" Width="75" Content="{Binding Path=CurrentEntity.PrecioMolde}"/>
                    <Label Grid.Row="2" Grid.Column="4" Width="75" Content="{Binding Path=CurrentEntity.PrecioPositivo}"/>
                </Grid>
                <Grid Name="Totales" Grid.Row="1" Grid.ColumnSpan="3" VerticalAlignment="Center">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60" />
                        <ColumnDefinition Width="90" />
                        <ColumnDefinition Width="90" />
                        <ColumnDefinition Width="50" />
                        <ColumnDefinition Width="90" />
                        <ColumnDefinition Width="90" />
                        <ColumnDefinition Width="70" />
                        <ColumnDefinition Width="90" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="31" />
                    </Grid.RowDefinitions>
                    <Frame Grid.ColumnSpan="9" Grid.RowSpan="6" BorderBrush="Gray" BorderThickness="1" Background="LightGray" />
                    <TextBlock Text="Subtotal" Grid.Column="0" />
                    <TextBlock Text="Total" Grid.Column="3" />
                    <TextBlock Text="Total USD" Grid.Column="6"/>
                    <Label Grid.Row="1" Grid.Column="1" Width="90" Content="{Binding Path=CurrentEntity.Subtotal}"/>
                    <Label Grid.Row="1" Grid.Column="4" Width="90" Content="{Binding Path=CurrentEntity.TotalCol}"/>
                    <Label Grid.Row="1" Grid.Column="7" Width="90" Content="{Binding Path=CurrentEntity.TotalUSD}"/>
                </Grid>
            </Grid>
        </GroupBox>
    </Grid>
</UserControl>
